define(["jquery", "easy-admin", "vue", "iconPickerFa", "treetable",], function ($, ea, Vue) {

    var form         = layui.form,
        element      = layui.element,
        treetable    = layui.treetable,
        table        = layui.table,
        iconPickerFa = layui.iconPickerFa;

    let app;
    return {
        create() {

            this.iconCheckRender();
            ea.listen(function (field) {
                field.status = 1;
                return field;
            }, function () {
                ea.api.closeCurrentOpen();
                parent.renderLeftTable();
            });
        },
        edit() {
            this.iconCheckRender()
            ea.listen(function (field) {
                return field;
            }, () => {
                ea.api.closeCurrentOpen();
                parent.renderLeftTable();
            });
        },
        iconCheckRender() {
            iconPickerFa.render({
                elem   : '#icon',
                url    : PATH_CONFIG.iconLess,
                limit  : 100,
                click  : function (data) {
                    $('#icon').val('fa ' + data.icon);
                },
                success: function (d) {
                    console.log(d);
                }
            });
        }
    };
});